<?php
namespace app\common\model;
use app\common\model\CommonModel;
use think\Db;

class OrderConsult extends CommonModel
{
	/**
	* 添加咨询信息
	*/
	public function serOrderConsult($data)
	{
		return $this->insertGetId($data);
	}
    /**
	* 获取咨询信息列表
	*/
	public function getConsultList($where,$field,$limit,$page,$group = 'o.order_consult_id')
	{
        $item = $this->alias('o')
				->join('mps_consult_goods g','o.order_consult_id = g.order_consult_id')
				->where($where)->field($field)
                ->group($group)
                ->order('o.addtime DESC')
                ->paginate($limit,false,['page'=>$page]);
        return empty($item) ? array():$item->toArray();
	}
    /**
    * 详情信息
    */
    public function getConsultInfo($where)
    {
        $item = $this->where($where)->find();
        return empty($item) ? array():$item->toArray();
    }
}
